/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.acmwustl.bubble.util;

/**
 *
 * @author Tyler
 */
public class PriceToString {

    public static String getPriceAsString(int priceInCents) {
        //100 to 1.00 or 230 to 2.30
        String s = "$"+String.valueOf((float)priceInCents/100.0f);

        int i = s.lastIndexOf(".");//finds the decimal point
        if(i == -1)
            s += ".00";
        else if(s.substring(i).length() <= 2)
            s += "0";

        return s;
    }
}
